package com.zan.pattern.responsibility;

/**
 * @Author Zan
 * @Create 2024/4/27 11:11
 * @Description : TODO(请用一句话描述该类的功能)
 * @ClassName: Client
 */
public class Client {
    public static void main(String[] args) {
        // 创建一个请假条对象
        LeaveRequest leave1 = new LeaveRequest("张三", 1, "身体不适");
        LeaveRequest leave2 = new LeaveRequest("张三", 3, "身体不适");

        // 创建各级领导对象
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        // 设置处理者链
        groupLeader.setNextHandler(manager);
        manager.setNextHandler(generalManager);

        // 提交请假申请
        groupLeader.submit(leave1);
        groupLeader.submit(leave2);
    }
}
